import request from '@/utils/request'
import defaultSettings from '@/settings'

export function fetchList(query) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/flowable/form/list',
    method: 'post',
    data: query
  })
}
export function save(data) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/flowable/form/save',
    method: 'post',
    data: data
  })
}

export function removeByIds(ids) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/flowable/form/removeByIds?ids=' + ids,
    method: 'get'
  })
}

/**
 * 获取开始节点表单
 * @param {*} deploymentId 
 */
export function getStartFormInfo(deploymentId) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/flowable/form/getStartFormInfo?deploymentId=' + deploymentId,
    method: 'get'
  })
}
/**
 * 获取任务节点表单
 * @param {*} taskId 
 * @param {*} processInstanceId 
 */
export function getFormInfoByTaskIdAndProcessInstanceId(taskId,processInstanceId) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/flowable/form/getFormInfo?taskId=' + taskId +'&processInstanceId='+processInstanceId,
    method: 'get'
  })
}